package CCN::modules::core_jabber_client;
# Copyright (C) 2006, 2007  Stephane Alnet
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
use strict; use warnings;

use base qw(CCN::Core::Module);

use CCN::Core::Configuration;

sub _description
{
    return {
        name        => 'core-jabber-client',
        title       => 'Jabber Client',
        description => 'This module provides the Jabber (XMLRPC) Client for CarrierClass.net.',
        group       => 'Core',
        version     => '0.1',
        requires    => [qw(bootstrap)],
        operations  =>
        {
            install => 
            {
                do => sub
                {
                    my $self = shift;
                    # Create the default entries in the Configuration
                    CCN::Core::Configuration::set('spool_jabber_domain','');
                    CCN::Core::Configuration::set('spool_jabber_server','127.0.0.1');
                    CCN::Core::Configuration::set('spool_jabber_port','5222');
                    CCN::Core::Configuration::set('spool_jabber_username','XXX');
                    CCN::Core::Configuration::set('spool_jabber_password','XXX');
                    return 1;
                }
            },
            insert =>
            {
                do => sub
                {
                    # Executed when the Jabber server for the meta-system is updated.
                    
                }
            },
            status =>
            {
                do => sub
                {
                    my $self = shift;
                    # Check whether we can access the server.
                },
            }
        },
    }
}


1;